    		<div id="sticky_navigation" style="height:30px;border-bottom:4px solid #DFDFDF;">
        	<p class="pull-left" style="font-size:16px; line-height:30px;"><strong><?php echo $this->translate('管理分类'); ?></strong></p>
        	<p class="pull-right">
        	<a href="<?php echo $this->url('classetutor/default',array('action'=>'add','controller'=>'class')); ?>" class="btn btn-small btn-primary"><i class="icon-plus icon-white"></i> <?php echo $this->translate('添加分类'); ?></a>&nbsp;
        	<a href="<?php echo $this->myviewalias()->dbshopHelpUrl('goods_class_set'); ?>" target="_blank" class="btn btn-small btn-info"><i class="icon-info-sign icon-white"></i> <?php echo $this->translate('查看帮助说明'); ?></a>
        	</p>
        	</div>
            <form action="<?php echo $this->url('classetutor/default',array('action'=>'allUpdate','controller'=>'class')); ?>" name="goods_class_form" id="goods_class_form" method="post">
            <table class="table table-hover">
            <thead style="background:#CCC;">
            	<tr>
                    <th width="40%"><?php echo $this->translate('商品分类名称 (分类ID)'); ?></th>
                    <th width="10%"><?php echo $this->translate('商品数量'); ?></th>
                    <th width="10%"><?php echo $this->translate('分类排序'); ?></th>
                    <th width="10%"><?php echo $this->translate('状态'); ?></th>
                    <th width="30%"><?php echo $this->translate('操作'); ?></th>
                </tr>
            </thead>
            <?php
			if ($this->goods_class) {
				foreach ($this->goods_class as $class_val) {
			?>
            <tr>
            	<td>
                    <input type="hidden" name="class_id[]" value="<?=$class_val['class_id'] ?>">
                    <?php echo str_repeat('&nbsp;', $class_val['class_level'] * 5); ?><i class="icon-chevron-right"></i><?php echo $this->escapeHtml($class_val['class_name']); ?> (ID:<?php echo $class_val['class_id']; ?>)</td>
            	<td id="goods_num_<?=$class_val['class_id'] ?>">
                    <img src="<?php echo $this->basePath('public/admin/img/update_loading.gif'); ?>" width="20px" border="0" />
                </td>
            	<td><input type="text" class="span8" name="class_sort[<?php echo $class_val['class_id']; ?>]" value="<?php echo $class_val['class_sort']; ?>"></td>
            	<td><?php if($class_val['class_state'] == 1) { echo $this->translate('已启用'); } else { echo '<strong style="color: red;">'.$this->translate('已禁用').'</strong>';} ?></td>
            	<td>
                	<a href="<?php echo $this->url('classetutor/default/top_class_id',array('action'=>'add','controller'=>'class','top_class_id'=>$class_val['class_id'])); ?>"><?php echo $this->translate('添加子类'); ?></a>
                    <span>|</span>
                    <a href="<?php echo $this->url('classetutor/default/class_id',array('action'=>'edit','controller'=>'class','class_id'=>$class_val['class_id']),null,true); ?>"><?php echo $this->translate('分类编辑'); ?></a>
                    <span>|</span>
                    <a href="javascript:;" onclick="return class_del_js(<?php echo $class_val['class_id']; ?>);"><?php echo $this->translate('删除分类'); ?></a>
                    <span>|</span>
                    <a href="<?php echo $this->url('goodsetutor/default/goods_class_id',array('action'=>'add','controller'=>'goods','goods_class_id'=>$class_val['class_id'])); ?>"><?php echo $this->translate('商品添加'); ?></a>
<!--                    <span>|</span>-->
<!--                    <a href="--><?php //echo $this->url('frontgoodslist/default', array('class_id'=>$class_val['class_id'])); ?><!--" target="_blank">--><?php //echo $this->translate('分类预览'); ?><!--</a>-->
                </td>  
            </tr>
            <?php
				}
            ?>
                <tr>
                    <td colspan="5" style="background: #FFF">
                        <div class="pull-left span6" style="height: 30px; line-height: 30px;">
                            <button type="submit" class="btn btn-small btn-primary"><i class="icon-tasks icon-white"></i> <?php echo $this->translate('批量修改'); ?></button>
                        </div>
                    </td>
                </tr>
			<?php } else {
			?>
			<tr><td colspan="5"><?php echo $this->translate('暂无商品分类'); ?></td></tr>
			<?php } ?> 
            </table>
            </form>
<script>
//分类删除操作js，检查分类下是否有子分类
function class_del_js(goods_class_id) {
	if(window.confirm('<?php echo $this->translate('您确实要删除该分类吗？'); ?>')) {
	$.post("<?php echo $this->url('classetutor/default',array('action'=>'del','controller'=>'class')); ?>",{class_id:goods_class_id},
	function(data){
		if(data != 'false') {
			window.location.href='<?php echo $this->url('classetutor/default',array('controller'=>'class')); ?>';
			return true;
		} else {
			alert('<?php echo $this->translate('该分类下还有子分类，无法删除该分类！'); ?>');
		}
	});
	}
	return false;
}

$("input[name='class_id[]']").each(function() {
    $.get("<?php echo $this->url('classetutor/default',array('action'=>'classGoodsNum')); ?>",{class_id:this.value},
        function(data){
            if(data.state == 'true') {
                $('#goods_num_'+data.class_id).html(data.goods_num);
            }
        }, 'json');
});
</script>